package org.chickymate.server.controller.command.json;

import org.chickymate.server.controller.RequestWrapper;
import org.json.JSONException;
import org.json.JSONObject;

public class AddCommentCommand extends JSONAbstractCommand {

	@Override
	public Object execute(RequestWrapper request) {
		getCommentDao().addComment(request.getUrl(), request.getComment());
		return "success";
	}

	@Override
	protected JSONObject resultToJson(Object object) throws JSONException {
		return getSuccessMessage("addCommentResult", object);
	}

}
